package edu.hqu.deepspace.service;

import edu.hqu.deepspace.dao.OrderMapper;
import edu.hqu.deepspace.pojo.Order;
import org.junit.Test;

import java.util.List;

public class OrderServiceImpl implements OrderService{

//    service层调dao层 将dao层组合进来
    private OrderMapper orderMapper;
    public void setOrderMapper(OrderMapper orderMapper) {
        this.orderMapper = orderMapper;
    }
//    set方法，便于spring注解进来

    @Override
    public int addOrder(Order order) {
        return orderMapper.addOrder(order);
    }

    @Override
    public int deleteOrder(int oid) { return orderMapper.deleteOrder(oid); }

    @Override
    public int updateOrder(Order order) {
        return orderMapper.updateOrder(order);
    }

    @Override
    public List<Order> queryOrder() {
        return orderMapper.queryOrder();
    }

    @Override
    public Order queryOrderById(int oid) {
        return orderMapper.queryOrderById(oid);
    }
}
